﻿using System;
using System.Collections.Generic;
using System.Collections;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Drawing_Vector_Graphics
{
    /// <summary>
    /// Interaction logic for DrawingSurface.xaml
    /// </summary>
    public partial class DrawingSurface : UserControl
    {
        ArrayList drawingObjects_Original;
        ArrayList drawingObjects_Trasformed;
        ArrayList transformChain;

        private Point originVar;

        public Point origin
        {
            get { return originVar; }
            set { originVar = value; }
        }
        
        public DrawingSurface()
        {
            InitializeComponent();
        }

        public void AddDot(int x, int y)
        {
            Ellipse o = new Ellipse();
            Canvas.SetLeft(o, x);
            Canvas.SetTop(o, y);
            o.Width = 1;
            o.Height = 1;

            drawingObjects_Original.Add(o);
        }

        public void AddRectangle(int x, int y, int width, int height)
        {
            Rectangle o = new Rectangle();
            Canvas.SetLeft(o, x);
            Canvas.SetTop(o, y);
            o.Width = width;
            o.Height = height;

            drawingObjects_Original.Add(o);
        }

        public void AddLine(int x1, int y1, int x2, int y2)
        {
            Line o = new Line();
            Canvas.SetLeft(o, x1);
            Canvas.SetTop(o, y1);
            o.X1 = x1;
            o.Y1 = y1;
            o.X2 = x2;
            o.Y2 = y2;
            drawingObjects_Original.Add(o);
        }

        private void drawCanvas(ArrayList drawingObjects)
        {
            canvas.Children.RemoveRange(0, canvas.Children.Count);
            foreach (Shape shape in drawingObjects)
            {
                canvas.Children.Add(shape);    
            }
        }

        public void AddLine(double x1, double y1, double x2, double y2)
        {

        }

    }
}
